
import { apiPrefix } from '@/consts/consts'

export default ({ $service:request }) => ({
  // 4.18.1. 推荐位列表
  featuredList(params) {
    return request({
      url: `${apiPrefix}/api/v1/featured/list`,
      method: 'get',
      params
    })
  },

  // 4.18.2. 推荐位新增
  featuredAdd(data) {
    return request({
      url: `${apiPrefix}/api/v1/featured/add`,
      method: 'post',
      data
    })
  },
  
  // 4.18.3. 推荐位修改
  featuredUpdate(data, id) {
    return request({
      url: `${apiPrefix}/api/v1/featured/update/${id}`,
      method: 'put',
      data
    })
  },
    
  // 4.18.4. 推荐位删除
  featuredDelete(id) {
    return request({
      url: `${apiPrefix}/api/v1/featured/delete/${id}`,
      method: 'delete',
    })
  },
    
  // 4.18.3. 推荐位修改
  featuredUpdateContent(data, id) {
    return request({
      url: `${apiPrefix}/api/v1/featured/update/content/${id}`,
      method: 'put',
      data
    })
  }
})
